home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Development
/
Source
/
DBL Pascal Library
/
CallChain ƒ
/
CallChain_Test.p
next >
Wrap
Text File
|
1992-10-31
|
825b
|
35 lines
program CallChain_Test;
uses
CallChain;
var
frame: Ptr;
aName: Str255;
anOffset: Integer;
found: Boolean;
procedure Proc1;
var
trace: CharsHandle;
traceSize: Size;
complete: Boolean;
begin
found := GetCallerInfo(0, frame, aName, anOffset);
writeln(found, ' "', aName, '" ', Ptr(anOffset));
found := GetCallerInfo(1, frame, aName, anOffset);
writeln(found, ' "', aName, '" ', Ptr(anOffset));
found := GetCallerInfo(2, frame, aName, anOffset);
writeln(found, ' "', aName, '" ', Ptr(anOffset));
traceSize := 1000;
trace := CharsHandle(NewHandleClear(traceSize));
complete := GetStackTrace(0, trace, traceSize);
DisposeHandle(Handle(trace));
end;
begin
ShowText;
found := GetCallerInfo(0, frame, aName, anOffset);
writeln(found, ' "', aName, '" ', Ptr(anOffset));
Proc1;
end.